﻿
Imports ValidationFramework

Public Class Address
    Inherits NotifyValidatableBase
	  Public Sub New()
        MyBase.New()
        PropertyValidationManager.ValidateAll()
  End Sub

    ' Properties
    <RequiredStringRule> _
    Public Property AddressLine1 As String
        Get
            Return _addressLine1
        End Get
        Set(ByVal value As String)
            If (value <> addressLine1) Then
                _addressLine1 = value
                MyBase.NotifyAndValidate(AddressLine1Member)
            End If
        End Set
    End Property

    <RequiredStringRule> _
    Public Property AddressLine2 As String
        Get
            Return _addressLine2
        End Get
        Set(ByVal value As String)
            If (value <> _addressLine2) Then
                _addressLine2 = value
                MyBase.NotifyAndValidate(AddressLine2Member)
            End If
        End Set
    End Property

 

 

    ' Fields
    Private _addressLine1 As String
    Private Const Addressline1Member As String = "AddressLine1"
    Private _addressLine2 As String
    Private Const Addressline2Member As String = "AddressLine2"
End Class